package bennyhuo.generic

interface Book

class EduBook : Book

/**
 * 生产者
 */
class BookStore<out T : Book>(val book: T)


fun main() {
    val eduBookStore: BookStore<EduBook> = BookStore<EduBook>(EduBook())
    val bookStore: BookStore<Book> = eduBookStore

    val eduBook: EduBook = eduBookStore.book
    val book: Book = bookStore.book
}